﻿@model ViewModels.Contact.EditModel
@{
    object id = ViewContext.RouteData.Values["id"];
}
<form method="post" zyf-edit-contact>
    <div class="form-group">
        <label>微信：</label>
        <label class="float-right text-success"></label>
        <input asp-for="Wechat" class="form-control" />
        <span asp-validation-for="Wechat" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label>QQ：</label>
        <label class="float-right text-success"></label>
        <input asp-for="QQ" class="form-control" />
        <span asp-validation-for="QQ" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label class="text-danger">Email：（建议填写）</label>
        <label class="float-right text-success"></label>
        <input asp-for="Email" class="form-control" placeholder="可用于接受系统通知等" />
        <span asp-validation-for="Email" class="text-danger" zyf-email-validation></span>
    </div>
    <div class="form-group">
        <label>其他：</label>
        <label class="float-right text-success"></label>
        <input asp-for="Other" class="form-control" />
        <span asp-validation-for="Other" class="text-danger"></span>
    </div>
    <div>
        <button  class="btn btn-primary" type="submit">提交</button>
        <button class="btn btn-default btn-outline-secondary" data-dismiss="modal" type="button">放弃</button>
    </div>
</form>

<script>
    $(function () {
        $('[zyf-edit-contact]').submit(function (event) {
            formSubmit(event, {
                url: '/api/Contact/_Edit?id=' + @id,
                success: function (data) {
                    $modal.modal('hide');
                }
            });
        })
    })
</script>